const { defineConfig } = require('@vue/cli-service')
const webpack = require('webpack')

const { ModuleFederationPlugin } = webpack.container

module.exports = defineConfig({
  transpileDependencies: true,
  configureWebpack: {
    plugins: [
      new ModuleFederationPlugin({
        name: 'app_base',
        remotes: {
          app1: 'app1@http://localhost:8080/remoteEntry.js',
          app2: 'app2@http://localhost:8081/remoteEntry.js',
        },
        shared: {
          vue: {
            requiredVersion: '^3.2.13',
            eager: true
          }
        }
      })
    ]
  }
})